package com.example.springsecuritydemo01.dao;

import com.example.springsecuritydemo01.pojo.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("select * from user where username=#{username}")
    User SelectByUsername(String username);

    @Select("select role_id from user_role where user_id=#{userId}")
    List<Integer> selectRoleIdByUserId(Integer userId);

    List<String> selectRoleByIds(List<Integer> ids);

    @Select("select power_id from role_power where role_id=#{id}")
    List<Integer> selectPowerIdByRoleId(Integer id);

    List<String> selectPowerByIds(List<Integer> ids);
}
